package movie.test.as.category.biz;

import java.util.List;
import java.util.Map;

import movie.test.as.category.dao.CategoryDao;
import movie.test.common.BaseBiz;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Component
public class CategoryBiz extends BaseBiz{

  @Autowired
  private CategoryDao categoryDao;
	public int addCategory(JSONObject objs) {

		return categoryDao.addCategory(objs);
	}
	public int updateCategory(JSONObject objs) {
		
		return categoryDao.updateCategory(objs);
	}
	public int deleteCategory(JSONObject objs) {
		
		return categoryDao.deleteCategory(objs);
	}
	public List<Map<String, Object>> findAllCategory(JSONObject objs) {
		PageHelper.startPage(getPagePara(objs));
		return categoryDao.findAllCategory(objs);
	}
	public PageInfo<Map<String, Object>> getMovieInfoByCategoryId(JSONObject objs) {
		
	
		return categoryDao.getMovieInfoByCategoryId(objs);
	}
	public Map<String, Object> getCategoryById(JSONObject objs) {
		
		return categoryDao.getCategoryById(objs);
	}
	


}
